/**
 * LogScoreAgentService.java
 * Copyright(C) 1949++ 中华人民共和国
 * 深圳市盛开互联网金融顾问有限公司.
 * All rights reserved.
 * E-mail:server@skjr.net
 * SKDate:2017-11-16 17:28:58
 */
package com.huamao.zh.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.huamao.zh.base.PageWrapper;
import com.huamao.zh.mapper.LogScoreAgentMapper;
import com.huamao.zh.model.LogScoreAgent;
import com.huamao.zh.service.LogScoreAgentService;

@Service
@Transactional
public class LogScoreAgentServiceImpl implements LogScoreAgentService {

	@Autowired
	private LogScoreAgentMapper logScoreAgentMapper;

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreAgent add(LogScoreAgent logScoreAgent) throws Exception {
		logScoreAgentMapper.add(logScoreAgent);
		return logScoreAgent;
	}

	public LogScoreAgent add(int type, int fromId, int agentId, String orderNo, BigDecimal preScore, int scoreType,
			BigDecimal getScore, String remark) throws Exception {
		LogScoreAgent logScore = new LogScoreAgent();
		logScore.setType(type);
		logScore.setAgentId(agentId);
		logScore.setOrderNo(orderNo);
		logScore.setPreScore(preScore);
		logScore.setScoreType(scoreType);
		logScore.setScore(getScore);
		logScore.setRemark(remark);
		logScore.setDataFlag(1);
		logScore.setCreateTime(new Date());
		logScoreAgentMapper.add(logScore);
		return logScore;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreAgent addSelective(LogScoreAgent logScoreAgent) throws Exception {
		logScoreAgentMapper.addSelective(logScoreAgent);
		return logScoreAgent;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int delete(Map<String, Object> map) {
		return logScoreAgentMapper.delete(map);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int update(LogScoreAgent logScoreAgent) throws Exception {
		return logScoreAgentMapper.update(logScoreAgent);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int updateSelective(LogScoreAgent logScoreAgent) throws Exception {
		return logScoreAgentMapper.updateSelective(logScoreAgent);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreAgent get(Integer id) {
		LogScoreAgent logScoreAgent = logScoreAgentMapper.get(id);
		return logScoreAgent;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public PageWrapper<LogScoreAgent> search(PageWrapper<LogScoreAgent> pageWrapper) {
		List<LogScoreAgent> logScoreAgents = logScoreAgentMapper.search(pageWrapper);
		pageWrapper.setList(logScoreAgents);
		return pageWrapper;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public List<LogScoreAgent> queryList(Map<String, Object> map) {
		return logScoreAgentMapper.queryList(map);
	}
}